* frame.h (FOR_EACH_FRAME): Change the definition so that
authorJim Blandy <jimb@redhat.com>
Thu, 18 Mar 1993 22:50:00 +0000 (22:50 +0000)
committerJim Blandy <jimb@redhat.com>
Thu, 18 Mar 1993 22:50:00 +0000 (22:50 +0000)
FRAME_VAR is a lisp object.
* dispnew.c (WINDOW_CHANGE_SIGNAL, do_pending_window_change):
Adjusted appropriately.
* xdisp.c (redisplay): Adjusted appropriately.

* dispnew.c (Fredraw_frame): Give this appropriate definitions for
MULTI_FRAME and non-MULTI_FRAME configurations.
(Fredraw_display): Give this a non-MULTI_FRAME-dependent definition.

src/dispnew.c
src/frame.h
src/xdisp.c

index 6937e9a1cfc3f8f513bb67d2b9b304d79d04b12a..84c5fbfaeff95a2f460e7db3d1d0b375e60976e5 100644 (file)
@@ -165,36 +165,6 @@ DEFUN ("redraw-frame", Fredraw_frame, Sredraw_frame, 1, 1, 0,
   return Qnil;
 }
 
-DEFUN ("redraw-display", Fredraw_display, Sredraw_display, 0, 0, "",
-  "Clear and redisplay all visible frames.")
-  ()
-{
-  Lisp_Object frame, tail;
-
-  for (tail = Vframe_list; CONSP (tail); tail = XCONS (tail)->cdr)
-    {
-      frame = XCONS (tail)->car;
-
-      /* If we simply redrew all visible frames, whether or not they
-        were garbaged, then this would make all frames clear and
-        redraw whenever a new frame is created or an existing frame
-        is de-iconified; those events set the global frame_garbaged
-        flag, to which redisplay responds by calling this function.
-
-        This used to redraw all visible frames; the only advantage of
-        that approach is that if a frame changes from invisible to
-        visible without setting its garbaged flag, it still gets
-        redisplayed.  But that should never happen; since invisible
-        frames are not updated, they should always be marked as
-        garbaged when they become visible again.  If that doesn't
-        happen, it's a bug in the visibility code, not a bug here.  */
-      if (FRAME_VISIBLE_P (XFRAME (frame))
-         && FRAME_GARBAGED_P (XFRAME (frame)))
-       Fredraw_frame (frame);
-    }
-  return Qnil;
-}
-
 redraw_frame (f)
      FRAME_PTR f;
 {
@@ -203,11 +173,12 @@ redraw_frame (f)
   Fredraw_frame (frame);
 }
 
-#else /* not MULTI_FRAME */
+#else
 
-DEFUN ("redraw-display", Fredraw_display, Sredraw_display, 0, 0, "",
-  "Clear screen and output again what is supposed to appear on it.")
-  ()
+DEFUN ("redraw-frame", Fredraw_frame, Sredraw_frame, 1, 1, "",
+  "Clear frame FRAME and output again what is supposed to appear on it.")
+  (frame)
+     Lisp_Object frame;
 {
   update_begin (0);
   set_terminal_modes ();
@@ -222,7 +193,35 @@ DEFUN ("redraw-display", Fredraw_display, Sredraw_display, 0, 0, "",
   return Qnil;
 }
 
-#endif /* not MULTI_FRAME */
+#endif
+
+DEFUN ("redraw-display", Fredraw_display, Sredraw_display, 0, 0, "",
+  "Clear and redisplay all visible frames.")
+  ()
+{
+  Lisp_Object tail, frame;
+
+  FOR_EACH_FRAME (tail, frame)
+    /* If we simply redrew all visible frames, whether or not they
+       were garbaged, then this would make all frames clear and
+       nredraw whenever a new frame is created or an existing frame
+       is de-iconified; those events set the global frame_garbaged
+       flag, to which redisplay responds by calling this function.
+       
+       This used to redraw all visible frames; the only advantage of
+       that approach is that if a frame changes from invisible to
+       visible without setting its garbaged flag, it still gets
+       redisplayed.  But that should never happen; since invisible
+       frames are not updated, they should always be marked as
+       garbaged when they become visible again.  If that doesn't
+       happen, it's a bug in the visibility code, not a bug here.  */
+    if (FRAME_VISIBLE_P (XFRAME (frame))
+       && FRAME_GARBAGED_P (XFRAME (frame)))
+      Fredraw_frame (frame);
+
+  return Qnil;
+}
+
 \f
 static struct frame_glyphs *
 make_frame_glyphs (frame, empty)
@@ -1605,14 +1604,13 @@ window_change_signal ()
      later outside of the signal handler.  */
 
   {
-    Lisp_Object tail;
-    FRAME_PTR f;
+    Lisp_Object tail, frame;
 
-    FOR_EACH_FRAME (tail, f)
+    FOR_EACH_FRAME (tail, frame)
       {
-       if (FRAME_TERMCAP_P (f))
+       if (FRAME_TERMCAP_P (XFRAME (frame)))
          {
-           change_frame_size (f, height, width, 0, 1);
+           change_frame_size (XFRAME (frame), height, width, 0, 1);
            break;
          }
       }
@@ -1631,13 +1629,14 @@ do_pending_window_change ()
   /* If window_change_signal should have run before, run it now.  */
   while (delayed_size_change)
     {
-      Lisp_Object tail;
-      FRAME_PTR f;
+      Lisp_Object tail, frame;
 
       delayed_size_change = 0;
 
-      FOR_EACH_FRAME (tail, f)
+      FOR_EACH_FRAME (tail, frame)
        {
+         FRAME_PTR f = XFRAME (frame);
+
          int height = FRAME_NEW_HEIGHT (f);
          int width = FRAME_NEW_WIDTH (f);
            
index 914d2ffba10fb6e3f1f6ca90233e6e7ac13fc488..0f7ac73654581d6c68bea4528a729a442c7cb89d 100644 (file)
@@ -317,9 +317,9 @@ typedef struct frame *FRAME_PTR;
 
 /* FOR_EACH_FRAME (LIST_VAR, FRAME_VAR) followed by a statement is a
    `for' loop which iterates over the elements of Vframe_list.  The
-   loop will set FRAME_VAR, a FRAME_PTR, to each frame in
+   loop will set FRAME_VAR, a Lisp_Object, to each frame in
    Vframe_list in succession and execute the statement.  LIST_VAR
-   should be a Lisp_Object; it is used to iterate through the
+   should be a Lisp_Object too; it is used to iterate through the
    Vframe_list.  
 
    If MULTI_FRAME isn't defined, then this loop expands to something which 
@@ -327,7 +327,7 @@ typedef struct frame *FRAME_PTR;
 #define FOR_EACH_FRAME(list_var, frame_var)                    \
   for ((list_var) = Vframe_list;                               \
        (CONSP (list_var)                                       \
-       && (frame_var = XFRAME (XCONS (list_var)->car), 1));    \
+       && (frame_var = XCONS (list_var)->car, 1));             \
        list_var = XCONS (list_var)->cdr)
 
 
@@ -412,16 +412,16 @@ extern int last_nonminibuf_frame;
 
 /* FOR_EACH_FRAME (LIST_VAR, FRAME_VAR) followed by a statement is a
    `for' loop which iterates over the elements of Vframe_list.  The
-   loop will set FRAME_VAR, a FRAME_PTR, to each frame in
+   loop will set FRAME_VAR, a Lisp_Object, to each frame in
    Vframe_list in succession and execute the statement.  LIST_VAR
-   should be a Lisp_Object; it is used to iterate through the
+   should be a Lisp_Object too; it is used to iterate through the
    Vframe_list.  
 
    If MULTI_FRAME _is_ defined, then this loop expands to a real
    `for' loop which traverses Vframe_list using LIST_VAR and
    FRAME_VAR.  */
 #define FOR_EACH_FRAME(list_var, frame_var)                    \
-  for (frame_var = (FRAME_PTR) 1; frame_var; frame_var = (FRAME_PTR) 0)
+  for (list_var = Qt; frame_var = selected_frame, ! NILP (list_var); list_var = Qnil)
 
 #endif /* not MULTI_FRAME */
 
index 02a70af1b2420a4d8b7f61e4e206f86be8565664..ee8d744958e6ca433e219c2bac53ff1c9b53bd2d 100644 (file)
@@ -369,11 +369,10 @@ redisplay ()
      to know if their frames are visible.
      See the comment in frame.h for FRAME_SAMPLE_VISIBILITY.  */
   {
-    Lisp_Object tail;
-    FRAME_PTR f;
+    Lisp_Object tail, frame;
 
-    FOR_EACH_FRAME (tail, f)
-      FRAME_SAMPLE_VISIBILITY (f);
+    FOR_EACH_FRAME (tail, frame)
+      FRAME_SAMPLE_VISIBILITY (XFRAME (frame));
   }
 
   /* Notice any pending interrupt request to change frame size.  */
@@ -504,15 +503,16 @@ redisplay ()
 
   if (all_windows)
     {
-      Lisp_Object tail;
-      FRAME_PTR f;
+      Lisp_Object tail, frame;
 
       /* Recompute # windows showing selected buffer.
         This will be incremented each time such a window is displayed.  */
       buffer_shared = 0;
 
-      FOR_EACH_FRAME (tail, f)
+      FOR_EACH_FRAME (tail, frame)
        {
+         FRAME_PTR f = XFRAME (frame);
+
          /* Mark all the scroll bars to be removed; we'll redeem the ones
             we want when we redisplay their windows.  */
          if (condemn_scroll_bars_hook)